﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/QuanLy.master" AutoEventWireup="true"
    CodeFile="Quan_Ly_Hang.aspx.cs" Inherits="Admin_Quan_Ly_Hang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label ID="thongbaoupdate" runat="server" Text=""></asp:Label>
    <asp:Panel ID="panel" Visible="true" runat="server">
        <asp:GridView ID="gvDuLieu" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
            AllowPaging="True" Width="100%" AllowSorting="True" AutoGenerateColumns="False"
            OnRowEditing="gvDuLieu_RowEditing" OnPageIndexChanging="gvDuLieu_PageIndexChanging"
            OnRowCancelingEdit="gvDuLieu_RowCancelingEdit" OnRowDeleting="gvDuLieu_RowDeleting"
            OnRowUpdating="gvDuLieu_RowUpdating" OnSorting="gvDuLieu_Sorting">
            <Columns>
                <asp:BoundField DataField="mahh" HeaderText="MAHH" ReadOnly="True" SortExpression="mahh">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <asp:HyperLink ID="xemchitiet" ImageUrl="~/images/nut/chitiet.gif" Target="_blank"
                            NavigateUrl='<%# "../Xem_Hang_Hoa.aspx?mahh=" + Eval("mahh") %>' runat="server"></asp:HyperLink>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="MLHH" SortExpression="maloaihh">
                    <EditItemTemplate>
                        <asp:DropDownList Width="100px" ID="maloaihh2" DataSource='<%#tao_danh_sach_maloaihh_edit()%>'
                            DataTextField="tenloaihh" DataValueField="maloaihh" runat="server">
                        </asp:DropDownList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%#Eval("maloaihh")%>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="MNSX" SortExpression="manhasx">
                    <EditItemTemplate>
                        <asp:DropDownList Width="100px" ID="manhasx2" DataSource='<%#tao_danh_sach_manhasx_edit()%>'
                            DataTextField="tennhasx" DataValueField="manhasx" runat="server">
                        </asp:DropDownList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%#Eval("manhasx")%>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="TÊN HÀNG" SortExpression="tenhh">
                    <EditItemTemplate>
                        <asp:TextBox ID="tenhh2" Width="100px" runat="server" Text='<%#Eval("tenhh") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="tenhh1" Width="100px" ReadOnly="true" runat="server" Text='<%#Eval("tenhh") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="M&#212; TẢ" SortExpression="motachitiet">
                    <EditItemTemplate>
                        <asp:TextBox ID="mota2" Width="100px" runat="server" Text='<%#Eval("motachitiet") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="mota1" Width="100px" ReadOnly="true" runat="server" Text='<%#Eval("motachitiet") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:BoundField DataField="soluongton" HeaderText="SLT" SortExpression="soluongton">
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="ĐVT" SortExpression="dvt">
                    <EditItemTemplate>
                        <asp:TextBox ID="dvt2" Width="50px" runat="server" Text='<%#Eval("dvt") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="dvt1" Width="50px" ReadOnly="true" runat="server" Text='<%#Eval("dvt") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ĐG" SortExpression="dongia">
                    <EditItemTemplate>
                        <asp:TextBox ID="dongia2" Width="100px" runat="server" Text='<%#Eval("dongia") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="dongia1" Width="100px" ReadOnly="true" runat="server" Text='<%#Eval("dongia") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ẢNH" SortExpression="hinhanh">
                    <EditItemTemplate>
                        <asp:TextBox ID="hinhanh2" Width="100px" runat="server" Text='<%#Eval("hinhanh") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="hinhanh1" Width="100px" ReadOnly="true" runat="server" Text='<%#Eval("hinhanh") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="BH" SortExpression="baohanh">
                    <EditItemTemplate>
                        <asp:TextBox ID="baohanh2" Width="50px" runat="server" Text='<%#Eval("baohanh") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="baohanh1" Width="50px" ReadOnly="true" runat="server" Text='<%#Eval("baohanh") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" CancelText="&lt;img border='0' src='images/nut/cancel.gif'&gt;"
                    DeleteText="X&#211;A" EditText="&lt;img border='0' src='images/nut/sua.jpg'&gt;"
                    InsertText="TH&#202;M" NewText="MỚI" SelectText="CHỌN" UpdateText="&lt;img border='0' src='images/nut/save.gif'&gt;" />
                <asp:CommandField ShowDeleteButton="True" CancelText="KH&#212;NG" DeleteText="&lt;img border='0' src='images/nut/xoa.jpg'&gt;"
                    EditText="SỬA" InsertText="TH&#202;M" NewText="MỚI" SelectText="CHỌN" UpdateText="LƯU" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <RowStyle CssClass="khongxuonghang" BackColor="#EFF3FB" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
            <PagerSettings FirstPageText="ĐẦU TI&#202;N" LastPageText="CUỐI C&#217;NG" PageButtonCount="5" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <br />
        <hr color="#008000" size="1">
        <asp:Label ID="thongbaotrantrung" runat="server" Text=""></asp:Label>
        <table width="100%">
            <tr>
                <td colspan="3">
                    <strong><span style="color: #ff0000">THÊM MỚI HÀNG HÓA</span></strong>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                </td>
            </tr>
            <tr>
                <td width="30%">
                    <span style="color: #0000ff">LOẠI HÀNG HÓA</span>
                </td>
                <td colspan="2">
                    <asp:DropDownList ID="maloaihh" DataTextField="tenloaihh" DataValueField="maloaihh"
                        runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: #0000ff">NHÀ SÃN XUẤT</span>
                </td>
                <td colspan="2">
                    <asp:DropDownList ID="manhasx" DataTextField="tennhasx" DataValueField="manhasx"
                        runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <span style="color: #0000ff">TÊN HÀNG HÓA</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="tenhanghoa" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">MÔ TẢ CHI TIẾT</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="motachitiet" runat="server" Height="100px" Width="95%" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">SỐ LƯỢNG</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="soluong" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">ĐƠN VỊ TÍNH</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="dvt" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">ĐƠN GIÁ</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="dongia" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">HÌNH ẢNH</span>
                </td>
                <td colspan="2">
                    <asp:FileUpload ID="hinhanh" runat="server" Width="95%" />
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    <span style="color: #0000ff">BẢO HÀNH</span>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="baohanh" runat="server" Width="95%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td colspan="2">
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td colspan="2">
                    <asp:Button ID="luuhanghoa" runat="server" Text="LƯU HÀNG HÓA" Height="30px" Width="50%"
                        OnClick="luuhanghoa_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
